package com.mycity.dao;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

public class RDSDao {
	private DriverManagerDataSource  dataSource;
	private JdbcTemplate template;

	
	public DataSource getDataSource() {
		dataSource = dataSource = new DriverManagerDataSource();
	    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
	    dataSource.setUrl("jdbc:mysql://titan.cmpe.boun.edu.tr:3306/database8");
	    dataSource.setUsername("project8");
	    dataSource.setPassword("unU4C2RA");
		return dataSource;
	}

	public void setDataSource(DriverManagerDataSource  dataSource) {
		this.dataSource = dataSource;
	}

	public JdbcTemplate getTemplate() {
		template = new JdbcTemplate(getDataSource());
		return template;
	}

	public void setTemplate(JdbcTemplate template) {
		this.template = template;
	}
}
